package com.icode.chat.message;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/**
 * Created with IntelliJ IDEA.
 * User: ZhongGang
 * Date: 14-8-2
 * Time: 下午7:24
 */
public class ChatMessage implements Message {
    private String chatter;
    private String content;
    private LocalTime chatTime = LocalTime.now();

    public ChatMessage(String content) {
        this.content = content;
    }

    public ChatMessage(String chatter, String content) {
        this.chatter = chatter;
        this.content = content;
    }

    public String getChatter() {
        return chatter;
    }

    public String getContent() {
        return content;
    }

    public String getChatTime() {
        return chatTime.format(DateTimeFormatter.ofPattern("hh:mm:ss"));
    }

    @Override
    public MessageType getMessageType() {
        return MessageType.CHAT;
    }
}
